'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=UserControl,UserControl,-1,Enabled
Public Property Get Enabled() As Boolean
Attribute Enabled.VB_Description = "Returns/sets a value that determines whether an object can respond to user-generated events."
Enabled = UserControl.Enabled
End Property
Public Property Let Enabled(ByVal New_Enabled As Boolean)
UserControl.Enabled() = New_Enabled
PropertyChanged "Enabled"
End Property
Sub ShowAboutBox()
Attribute ShowAboutBox.VB_Description = "Show About box"
Attribute ShowAboutBox.VB_UserMemId = -552
frmAbout.Show vbModal
Unload frmAbout
Set frmAbout = Nothing
End Sub
Public Property Get BorderStyle() As AxBorderStyles
Attribute BorderStyle.VB_Description = "Returns/sets the border style for the control."
BorderStyle = m_BorderStyle
End Property
Public Property Let BorderStyle(ByVal New_BorderStyle As AxBorderStyles)
If Not (m_BorderStyle = New_BorderStyle) Then
m_BorderStyle = New_BorderStyle
UserControl.Cls
UserControl_Paint
End If
PropertyChanged "BorderStyle"
End Property
''MappingInfo=UserControl,UserControl,-1,Ambient
'Public Property Get Ambient() As AmbientProperties
' Set Ambient = UserControl.Ambient
'End Property
Public Function Item(ByVal Key As Variant) As Object
Attribute Item.VB_Description = "Sets/gets information on a specific button"
If VarType(Key) = vbString Then
Key = Trim(Key)
End If
Set Item = mNodes.Item(Key)
End Function
Public Sub AddItem()
Attribute AddItem.VB_Description = "Add blank button to buttons collection"
Attribute AddItem.VB_MemberFlags = "40"
Dim NewItem As New clsItem, cnt As Integer
With NewItem
.Caption = ""
.Style = 0
.Tag = ""
.ToolTipText = ""
.Visible = 1
.Enabled = 1
.DropDown = 0
Set .Bitmap = Nothing
End With
mNodes.Add NewItem, LTrim(Str(mNodes.Count + 1))
End Sub
Public Property Get Count() As Integer
Attribute Count.VB_Description = "Returns number of buttons in button collection"
Count = mNodes.Count
End Property
Public Sub Remove(Index As Integer)
Attribute Remove.VB_Description = "Removes a specific button"
Attribute Remove.VB_MemberFlags = "40"
mNodes.Remove Index
End Sub
Public Sub ShowButtons()
Attribute ShowButtons.VB_Description = "Show all buttons"
Attribute ShowButtons.VB_MemberFlags = "40"
'delete and recreate all buttons
Dim cnt As Integer, currX As Integer
Dim iWidth As Integer, iHeight As Integer
RemoveButtons
If mNodes.Count = 0 Then
btnCool(1).Visible = False
Else
btnCool(1).Visible = False
If mNodes.Item(1).DropDown And (mNodes.Item(1).Style = [Cool Button] Or mNodes.Item(1).Style = [Standard Button] Or mNodes.Item(1).Style = [Toolbar Button]) Then
iWidth = IIf(bTextLabels, 52, 32)
ElseIf mNodes.Item(1).Style = Separator Or mNodes.Item(1).Style = [Toolbar Handle] Then
Set btnCool(1).Picture = IIf(mNodes.Item(1).Bitmap Is Nothing, Nothing, mNodes.Item(1).Bitmap)
mNodes.Item(1).Left = btnCool(1).Left
btnCool(1).Visible = mNodes.Item(1).Visible
For cnt = 2 To mNodes.Count
Load btnCool(cnt)
btnCool(cnt).Visible = False
If mNodes.Item(cnt).DropDown And (mNodes.Item(cnt).Style = [Cool Button] Or mNodes.Item(cnt).Style = [Standard Button] Or mNodes.Item(cnt).Style = [Toolbar Button]) Then
iWidth = IIf(bTextLabels, 52, 32)
ElseIf mNodes.Item(cnt).Style = Separator Or mNodes.Item(cnt).Style = [Toolbar Handle] Then
Attribute RedrawButtons.VB_Description = "Redraws all buttons from the button collection"
Attribute RedrawButtons.VB_MemberFlags = "40"
'delete and recreate all buttons
ShowButtons
PropertyChanged "Buttons"
End Sub
Public Sub UpdateButtons()
'redraw all buttons (no delete)
Dim cnt As Integer, currX As Integer
Dim iWidth As Integer, iHeight As Integer
If mNodes.Count = 0 Then
btnCool(1).Visible = False
Else
btnCool(1).Visible = False
If mNodes.Item(1).DropDown And (mNodes.Item(1).Style = [Cool Button] Or mNodes.Item(1).Style = [Standard Button] Or mNodes.Item(1).Style = [Toolbar Button]) Then
iWidth = IIf(bTextLabels, 52, 32)
ElseIf mNodes.Item(1).Style = Separator Or mNodes.Item(1).Style = [Toolbar Handle] Then
Set btnCool(1).Picture = IIf(mNodes.Item(1).Bitmap Is Nothing, Nothing, mNodes.Item(1).Bitmap)
mNodes.Item(1).Left = btnCool(1).Left
btnCool(1).Visible = mNodes.Item(1).Visible
For cnt = 2 To mNodes.Count
btnCool(cnt).Visible = False
If mNodes.Item(cnt).DropDown And (mNodes.Item(cnt).Style = [Cool Button] Or mNodes.Item(cnt).Style = [Standard Button] Or mNodes.Item(cnt).Style = [Toolbar Button]) Then
iWidth = IIf(bTextLabels, 52, 32)
ElseIf mNodes.Item(cnt).Style = Separator Or mNodes.Item(cnt).Style = [Toolbar Handle] Then
Attribute RemoveButtons.VB_Description = "Remove all buttons"
'remove all buttons from control except base one
Dim cnt As Integer
If btnCool().Count > 1 Then
For cnt = 2 To btnCool().Count
Unload btnCool(cnt)
Next
End If
End Sub
Public Property Get ShowFlatGrey() As Boolean
Attribute ShowFlatGrey.VB_Description = "Get/Sets a value to determine whether or not to display the picture in greyscale when the mouse is not over the button (Cool Button only)"
ShowFlatGrey = bShowFlatGrey
End Property
Public Property Let ShowFlatGrey(ByVal New_Value As Boolean)
bShowFlatGrey = New_Value
UpdateButtons
PropertyChanged "ShowFlatGrey"
End Property
Public Property Get TextLabels() As Boolean
Attribute TextLabels.VB_Description = "Sets/gets a value to determine whether buttons will show the text label"
TextLabels = bTextLabels
End Property
Public Property Let TextLabels(ByVal New_Value As Boolean)